/**
 * Created by Administrator on 2017/4/13.
 */
var swiper = new Swiper('.swiper-container', {
    pagination: '.swiper-pagination',
    paginationClickable: true,
    direction: 'vertical',
    onInit: function(swiper){ //Swiper2.x的初始化是onFirstInit
        swiperAnimateCache(swiper); //隐藏动画元素
        swiperAnimate(swiper); //初始化完成开始动画
    },
    onSlideChangeEnd: function(swiper){
        swiperAnimate(swiper); //每个slide切换结束时也运行当前slide动画
    }
});

//音乐控制
var music=document.getElementById('music');
var music_gif=document.getElementsByClassName('music_gif')[0];
var music_off=document.getElementsByClassName('music_off')[0];
var bgmusic=document.getElementsByClassName('bgmusic')[0];

var music_status=1;
music.onclick=function () {
    if(music_status==1){
        music_gif.style.display='none';
        music_off.style.animation='none';
        bgmusic.pause();
        music_status=2
    }else{
        music_gif.style.display='block';
        music_off.style.animation="run 3s linear infinite";
        bgmusic.play();
        music_status=1;
    }
}
//音乐控制结束